﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace TotalCrytography
{
    public partial class UnzipGUI : Form
    {
        String _zipFile;
        String _pass;
        public UnzipGUI()
        {
            InitializeComponent();
        }
        public UnzipGUI(String input)
        {
            InitializeComponent();
            _zipFile = input;
            tbPath.Text = input.Substring(0,input.LastIndexOf('\\')+1);
        }



        private void btUnzip_Click(object sender, EventArgs e)
        {
            Zip.Zip.UnZipFiles(_zipFile, tbPath.Text, tbPass.Text, false);
            DialogResult = DialogResult.OK;
        }

        private void btExit_Click(object sender, EventArgs e)
        {
            Close();
        }

        private void btBrowse_Click(object sender, EventArgs e)
        {
            FolderBrowserDialog fd = new FolderBrowserDialog();
            if (fd.ShowDialog() == DialogResult.OK)
                tbPath.Text = fd.SelectedPath + "\\";
        }


        

        
    }
}
